Claim Giftcode From Webview
Flow 1:
Overview:
- Enter the webview by clicking on the Dzo icon.
- Claim Giftcode
- [Code]: In Unity, Dev can get giftcode form SDKAPI.RegisCallbackRequestClaimGiftCode and send request add Item to Server Game.
- Call method SDKAPI.ConsumeGiftCode to SDK after add Item successful.
Init:
In Unity, after Init SDK Successful we need regist callback Request Claim Giftcode From Dzo Webview:
SDKAPI.initSuccessCallback = ()=>{
Debug.Log(">>> Call Init SDK Success <<<");
// - Register callback Claim GiftCode After Init Success - //
SDKAPI.RegisCallbackRequestClaimGiftCode((_result)=>{
Debug.Log(">>> Request Claim GiftCode: " + _result.giftCode + " - serverGameID: " + _result.severGameID);
// - After add Item successful, call consume giftcode - //
SDKAPI.ConsumeGiftCode(_result.giftCode);
});
// ---------------------------------- //
...
};
Consume:
After use giftcode and add Item successful, in Unity we need to call method Consume to SDK
SDKAPI.ConsumeGiftCode(_giftCode);
Flow 2:
Overview:
- Enter the webview by clicking on the Dzo icon.
- Claim Giftcode